return device->button_press_serial;
}
+static GdkAtom
+mime_type_to_gdk_atom (char *mime_type)
+{
+ if (strcmp (mime_type, "text/plain;charset=utf8"))
+ return gdk_atom_intern_static_string ("UTF8_STRING");
+
+ return GDK_NONE;
+}
+
gint
gdk_wayland_device_get_selection_type_atoms (GdkDevice *gdk_device,
GdkAtom **atoms_out)
/* Convert list of targets to atoms */
for (i = 0; i < device->selection_offer->types->len; i++)
- {
- atoms[i] = gdk_atom_intern (device->selection_offer->types->pdata[i],
- FALSE);
- GDK_NOTE (MISC,
- g_message (G_STRLOC ": Adding atom for %s",
- (char *)device->selection_offer->types->pdata[i]));
- }
+ atoms[i] = mime_type_to_gdk_atom (device->selection_offer->types->pdata[i]);
*atoms_out = atoms;
return device->selection_offer->types->len;
device_manager = gdk_display_get_device_manager (gdk_display_get_default ());
device = gdk_device_manager_get_client_pointer (device_manager);
+ if (target == gdk_atom_intern_static_string ("TARGETS"))
+ {
+ GtkSelectionData selection_data;
+ int n_atoms;
+ GdkAtom *atoms;
+
+ selection_data.selection = GDK_NONE;
+ selection_data.format = 32;
+ selection_data.type = GDK_SELECTION_TYPE_ATOM;
+
+ n_atoms = gdk_wayland_device_get_selection_type_atoms (device, &atoms);
+ selection_data.length = n_atoms;
+ selection_data.data = atoms;
+
+ callback (gtkclipboard, &selection_data, user_data);
+ return;
+ }
+
/* When GTK+ requests text, it tries UTF8_STRING first and then
* falls back to COMPOUND_TEXT and then STRING. We rewrite
* UTF8_STRING to text/plain;charset=utf-8, and if that doesn't